package package5;

class Parent {
    protected int num;  // protected修饰符
    public Parent() {
        num = 10;
    }
    protected void display() {  // protected修饰符
        System.out.println("This is the parent class.");
    }
}
public class Qualifier extends Parent {
    public static void main(String[] args) {
        Qualifier obj = new Qualifier();
        obj.display();  // 调用继承的父类方法
        System.out.println("The value of num is: " + obj.num);  // 访问继承的父类属性
    }
}
/*
输出：     This is the parent class.
          The value of num is: 10

 */